package com.ujiuye.util;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117685960";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCIzXUmr58qqP5mzfkoO2rfZP2zcqA4VNjsJYCI4TZnmPeJMj79wceZ0eiRElu9cfGpEzuhAMIYBDCWrQe8+sW45cYZ+/tH8dlnnmNvbcujM4cB4ppkqMuKlk7Mnt2uyelzJbaBg7WcomStkP+WSmQEWaGbv6aD5hbbmL1R5x0iV4PouKAuTxniJe8wM6+L2Ohmo6tNidJYJcyQLUUO1AHsTJwD0Frd9Q5kH/hpyPOfbpsjd5l3IcHBH/eZ8nqufalJHflgdgb4tV9J9oQRCiib+9O98WpKIzZBkU4g/ekxIR2+x6DdxFmNf3rPgoJSraIomkM/dC3t31GxEm8ypARRAgMBAAECggEAV/tzfdbzUfdv7mRH+xUDrfsAo3l0C+adwHp6CQ528/fQM59qHb+UBJyYqzyYXeW7W1bwQaMAMXv4V9+em27Y3QqB9tI1kNa9UMPwBYkir6qDCLZZP6XDijUTJsyBnFllV9YIY5F2qu9SOsKHbnwXiSiwJEAE8s13I/I+yD8QYLXhRMeSmPxJXSdES1usz3oa7N8MkW9ErIh+JfJxdcqTmgniEOaKWVptvWoINP9DD7UwA3nfJ7rLoIkRxSC6D274WfOGFkaTyXiHmnHHlUjWA3OzlEc6qf9LrO+qygwzo/teR3+w0/H2KUOy3TzN0DWH+IhpaluGh/rO2uNEgit9dQKBgQDDO3q0zq48BCMJluU0tOULIaAbXlcMeybCMcdWddsq43iH8Daok6NQbiG9kF1oxQbvVzKs0EzWuMsIkb5pATqKUrR93HtZbCaHJuIaPZv+Nt52qgaoXxUc9Zns2zWHGfrl0VaURXrkXWI3+SZJNxdfHLNn0UZSqd0AlPH2rjq3RwKBgQCzYiwJQ8418fpP4OpiZ36rhrUFSxmwGjlfyVWEuDPl7fSaNyC2jHHm015MvHOpnde57vZ9sy4JAqFjMj4SPyuXwCHZYSxE7GF0hDnhvpU3tnxU5YupfQlWypzjxH+LFKWZs9z6CS+dEo+BpVE0gPqkBMZn3h+puDDMv23updpjpwKBgQCEsqvvsz+IOYObI/48ueuoij1p/NCMAjTQ78a+xLKoTx6Av0xXfqoVpBW45CQpbyoMiic+gQKJO+d8tptGgfhJRne5yJ/qovD5EfvCvDeILcE9xMlrrd0K5wCtlj2my4jWplgDxcoG6FY3F1jnkNOI6Vgj64Gx9BTsLVDdS4VLRwKBgGeZuUkYig4J1MExauyuTTAPOpj2CL32R1CU3Pkr0X1n8q7mS9RiRJ5FUN8Mr9g0OxU9d8qdI2c8x6ycpdCv/yNDack8H+8mfhpnC27fPRrSH/iAIise9bfUiMva/rZ6lDGy+VrG12LmB0+fBMlH/Hmh8FyooqzInhaCMKF11C1dAoGBAMALaBVqId6pwyQRUizmP9ZtqpqjqRdzv9A23sCIFVKi9Qqzjnw4w5SkttUcuj3cBXXmZJsPGU8a8jdL/APmR6zNW0Oa5B0ndm87qFvVRXgJxTdFsVMl84iW5K22Q/HS/iUpR8RuYAUOAbTVtpVWNb1qhfg1eR5r/8RhN4Sy/uLD";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiM11Jq+fKqj+Zs35KDtq32T9s3KgOFTY7CWAiOE2Z5j3iTI+/cHHmdHokRJbvXHxqRM7oQDCGAQwlq0HvPrFuOXGGfv7R/HZZ55jb23LozOHAeKaZKjLipZOzJ7drsnpcyW2gYO1nKJkrZD/lkpkBFmhm7+mg+YW25i9UecdIleD6LigLk8Z4iXvMDOvi9joZqOrTYnSWCXMkC1FDtQB7EycA9Ba3fUOZB/4acjzn26bI3eZdyHBwR/3mfJ6rn2pSR35YHYG+LVfSfaEEQoom/vTvfFqSiM2QZFOIP3pMSEdvseg3cRZjX96z4KCUq2iKJpDP3Qt7d9RsRJvMqQEUQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";


    // 支付宝网关
    public static String log_path = "C:\\";

//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
